Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-13025] Elasticsearch 7.x support #9720

Closed
wants to merge 8 commits into from

Conversation

yanghua
Copy link
Contributor

@yanghua yanghua commented Sep 19, 2019

What is the purpose of the change

This pull request implemented a new elasticsearch connector to support elasticsearch 7.x

Brief change log

  • Implemented a new connector to support elasticsearch 7.x client
  • Make old test support elasticsearch 7.x client

Verifying this change

This change is already covered by existing tests, such as ElasticsearchSinkITCase and Elasticsearch7UpsertTableSinkFactoryTest.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 19, 2019

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 67f07a9 (Wed Oct 16 08:43:21 UTC 2019)

Warnings:

  • 6 pom.xml files were touched: Check for build and licensing issues.

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@yanghua
Copy link
Contributor Author

yanghua commented Sep 19, 2019

Note: This PR may not be ready for review especially for document support.

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 19, 2019

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build

@yanghua
Copy link
Contributor Author

yanghua commented Sep 20, 2019

@aljoscha What do you think about this PR? Anything that I missed, please let me know. Thanks

@aljoscha
Copy link
Contributor

I had a cursory glance at this. The code seems fine, because it's basically the ES 6 code. I have some general comments:

  • I don't think the ES connectors (both 6 and 7) need the Table Planner dependency anymore. Maybe @twalthr can confirm this, but you can also try removing them and seeing what happens.
  • I don't think we need Table-specific code in the connectors when there is the flink-sql-connector-elasticsearch7 module. Maybe the Table-related code can be moved to that module, along with the tests.

@yanghua
Copy link
Contributor Author

yanghua commented Sep 24, 2019

@aljoscha It seems you are right, we do not need the dependency of table planner.

Next, I will try to move the table-specific code from the es connector to SQL connector.

@yanghua yanghua force-pushed the FLINK-13025 branch 2 times, most recently from bfeeca4 to 3ba6a27 Compare September 25, 2019 02:36
@yanghua
Copy link
Contributor Author

yanghua commented Sep 25, 2019

@aljoscha I have addressed your comments (except moving table-specified code of flink-connector-elasticsearch6 to flink-sql-connector-elasticsearch6 module). Can you have another look?

@aljoscha
Copy link
Contributor

Yes, I will definitely look at this!

@@ -0,0 +1,45 @@
flink-sql-connector-elasticsearch7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this have a NOTICE file while the ES 6 connector doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aljoscha This NOTICE file referenced flink-sql-connector-elasticsearch6. The flink-connector-elasticsearch7 referenced flink-connector-elasticsrearch6, so they both have no NOTICE file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check whether the contents of the new NOTICE file is correct? A quick mvn dependency:tree on the new sql connector shows some dependencies that are not in the NOTICE file. I think these are new compared to ES6, which didn't have them. You can compare the output of mvn depdendency:tree on the ES6 sql jar and on the new ES7 sql jar and also compare to the NOTICE files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to check the dependency list. I will do the comparation soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aljoscha I have run mvn depdendency:tree command and checked the license of every dependency through maven repository. Can you review again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twalthr Any other additional remarks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aljoscha It seems @twalthr is busy recently? Can you talk with him offline to see if there is anything need to be considered?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is not correct, the list of flink-shaded dependencies has nothing to do with the local shading in this connector. What I did now is to look at the output of mvn clean install in the ES7 connector directory. It has a section about what is included and what is not included. Based on this information I added some additional exclusions and I updated the NOTICE file: aljoscha@b80c8b9. I will apply this fix and then merge the PR.

If you are more attentive to these subtle problems, like dependencies and the NOTICE file, the PR review process could be a lot smoother.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aljoscha Thanks. Actually, I am really not familar with NOTICE file and things about license.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is easy to underestimate this. That is the problem, also for me. 😅

@aljoscha
Copy link
Contributor

I merged this. 👌

@aljoscha aljoscha closed this Oct 14, 2019
@yanghua
Copy link
Contributor Author

yanghua commented Oct 15, 2019

@aljoscha Thanks for helping me to review this PR and finish this work.

@yanghua
Copy link
Contributor Author

yanghua commented Oct 15, 2019

I had a cursory glance at this. The code seems fine, because it's basically the ES 6 code. I have some general comments:

  • I don't think we need Table-specific code in the connectors when there is the flink-sql-connector-elasticsearch7 module. Maybe the Table-related code can be moved to that module, along with the tests.

@aljoscha When reviewed your first comment, it seems this is also a issue for ES 6 connector and sql connector. WDYT? Shall we fixed it?

@aljoscha
Copy link
Contributor

I think we can do that, yes.

@yanghua
Copy link
Contributor Author

yanghua commented Oct 15, 2019

OK, I have created a Jira issue to track this problem. Please see: FLINK-14395

@li-zhao-hotstar
Copy link

Hi @yanghua
Thanks for the effort.
Came from https://issues.apache.org/jira/browse/FLINK-13025, want to check is this available now?
https://ci.apache.org/projects/flink/flink-docs-stable/dev/connectors/elasticsearch.html still didn't reflect the update, also can not find flink-connector-elasticsearch7_2.11 in any repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants